package recursivecode;

/**
 * 功能描述:阶乘数
 * 2024/07/11
 *
 * @author ZhangYi
 */
public class NumberOfFactorial {
	/**
	 * 阶乘
	 *
	 * @param num num
	 * @return int
	 * @author ZhangYi
	 */
	private static int factorial(int num) {
		if (num <= 1) {
			return 1;
		}

		int factorial = factorial(num - 1);
		num = num * factorial;
		return num;
	}

	public static void main(String[] args) {
		System.out.println(factorial(10));
	}


}
